<?php
if(isset($_POST['submit_value']) && $_POST['submit_value']=='Login')
{
	$array=Db::mysql_query(" SELECT config_content FROM tbl_config WHERE config_name IN ('username','password') ORDER BY config_name DESC",FETCH_MODE_COLUMN);
	if($array[0]==$_POST['username'] && $array[1]==$_POST['password'])
	{
		$_SESSION['login']=1;
		Common::header_location('index.php');
	}
	else
	{
		Common::header_location(null,'Wrong username or password. Please try again!');//,"\$('#username').focus();"); 
	}
}
/*else
{
?>
	<script>
	$(document).ready(function(){
		$('#username').focus();
	})
	</script>
<?php 
}*/
?>

<form method='post'>
	<div style='margin:auto;width:230px'>
		<label>
			Username<br/>
			<input type='text' name='username' id='username'/>
		</label>
		<br/>
		<label>
			Password<br/>
			<input type='password' name='password' id='password'/>
		</label>
		<input type='submit' name='submit_value' value='Login'/>
	</div>
</form>